<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>菜单信息 Menu Form</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" th:href="@{/statics/layui/css/layui.css}" media="all">
  <link rel="stylesheet" th:href="@{/statics/style/admin.css}" media="all">
</head>
<body>

  <div class="layui-form" lay-filter="layuiadmin-form-menu" id="layuiadmin-form-menu" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
      <label class="layui-form-label">上级菜单</label>
      <div class="layui-input-block">
        <select name="pid">
          <option value="0">顶级菜单</option>
          <option th:each="m:${menus}" th:value="${m.id}" th:selected="${m.id == menu.pid ? 'true':'false'}" th:text="${'- '+ m.name}"/>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">菜单名称</label>
      <div class="layui-input-block">
        <input type="text" name="name" lay-verify="name" autocomplete="off" placeholder="请输入菜单名称" class="layui-input" th:value="${menu.name}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">菜单图标</label>
      <div class="layui-input-block">
        <input type="text" name="icon" autocomplete="off" placeholder="请输入图标" class="layui-input" th:value="${menu.icon}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">标识代码</label>
      <div class="layui-input-block">
        <input type="text" name="code" autocomplete="off" placeholder="请输入角色代码" class="layui-input" th:value="${menu.code}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">权限代码</label>
      <div class="layui-input-block">
        <input type="text" name="shiroCode" lay-verify="required" autocomplete="off" placeholder="请输入角色代码" class="layui-input" th:value="${menu.shiroCode}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">菜单URL</label>
      <div class="layui-input-block">
        <input type="text" name="url" lay-verify="required" autocomplete="off" placeholder="请输入菜单URL" class="layui-input" th:value="${menu.url}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">排序序号</label>
      <div class="layui-input-block">
        <input type="text" name="sorting" lay-verify="required" autocomplete="off" placeholder="请输入排序序号" class="layui-input" th:value="${menu.sorting}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">快捷方式</label>
      <div class="layui-input-block">
        <input type="radio" name="shortCut" value="1" title="是" th:checked="${menu.shortCut ==1?'true':'false'}">
        <input type="radio" name="shortCut" value="0" title="否" th:checked="${menu.shortCut ==0?'true':'false'}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">功能按钮</label>
      <div class="layui-input-block">
        <input type="checkbox" name="actions[]" th:each="act:${actions}" th:title="${act.name}" th:value="${act.code}" th:checked="${act.checked?'true':'false'}"/>
      </div>
    </div>
    <div class="layui-form-item layui-hide">
      <input type="hidden" name="id" th:value="${menu.id}" autocomplete="off" class="layui-input">
      <button class="layui-btn" lay-submit lay-filter="LAY-menu-add-submit" id="LAY-menu-add-submit">提交</button>
    </div>
  </div>

  <script th:src="@{/statics/layui/layui.js}"></script>
  <script>
  layui.config({
    base: '/statics/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form'], function(){
    var $ = layui.$
    ,form = layui.form ;
  })
  </script>
</body>
</html>